package com.hrz.datasync.controller;

import com.hrz.datasync.common.RetResponse;
import com.hrz.datasync.common.RetResult;
import com.hrz.datasync.pojo.primary.TpAdZone;
import com.hrz.datasync.kafka.producer.TpAdZoneProducer;
import com.hrz.datasync.pojo.secondary.BbqAdZone;
import com.hrz.datasync.service.BbqAdZoneService;
import com.hrz.datasync.service.TpAdZoneService;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @作  者: 侯建军
 * @日  期: 2018/11/05 10:36:59
 * @描  述: TpAdZoneAPI接口
 */
@RestController
@RequestMapping("/datasync")
@Log
public class TpAdZoneControllerApi {
    @Autowired
    private TpAdZoneService tpAdZoneService;
    @Autowired
    private BbqAdZoneService bbqAdZoneService;
    /**
     *
     * 功能描述: 
     * 添加数据
     * @参  数:
     * @返  回: 
     * @作  者: 侯建军
     * @日  期: 2018/11/05 10:40:14
     */
    @RequestMapping(value = "/sendTpAdZone", method = RequestMethod.POST)
    public RetResult<TpAdZone> sendTpAdZone(@RequestBody TpAdZone tpAdZone) {
        tpAdZoneService.sendTpAdZone(tpAdZone);
        return RetResponse.makeOKRsp();
    }

    @RequestMapping(value = "/sendBbqAdZone", method = RequestMethod.POST)
    public RetResult<BbqAdZone> sendBbqAdZone(@RequestBody BbqAdZone bbqAdZone) {
        bbqAdZoneService.sendBbqAdZone(bbqAdZone);
        return RetResponse.makeOKRsp();
    }
}
